Skip to content

Conversation

ks6088ts
Copy link
Member

@ks6088ts ks6088ts commented May 1, 2025

What this PR does / why we need it

  • add authentication scenario

Which issue(s) this PR fixes:

Fixes #3

Does this introduce a breaking change?

[ ] Yes
[x] No

Pull Request Type

What kind of change does this Pull Request introduce?

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Documentation content changes
[ ] Other... Please describe:

How to Test

  • Get the code
ORGANIZATION=<organization-name>
REPOSITORY=<repository-name>

git clone [email protected]:$ORGANIZATION/$REPOSITORY.git
cd $REPOSITORY
  • Test the code
make ci-test

What to Check

Verify that the following are valid

  • ...

Additional Information

@ks6088ts ks6088ts requested a review from Copilot May 1, 2025 08:37
@ks6088ts ks6088ts self-assigned this May 1, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces an authentication scenario to the project, providing both a Streamlit authenticator implementation and an alternative login screen using new Streamlit login callbacks.

  • Implements authentication using the streamlit_authenticator library in one app
  • Adds an alternative authentication screen using Streamlit’s new login/logout callbacks
  • Updates tests, scripts, configuration, and documentation to support authentication

Reviewed Changes

Copilot reviewed 13 out of 15 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
workshop_playwright_python/apps/streamlit_authentication.py Implements authentication with streamlit_authenticator and handles login errors
workshop_playwright_python/apps/authentication.py Provides an alternative login screen using new Streamlit callbacks
tests/test_hatena_bookmark.py Adds a test marked to be skipped for live-server dependent scenarios
tests/flags.py Introduces a flag to skip tests when necessary
scripts/save_context.py Adds a script to capture and save browser storage state
scripts/load_context.py Adds a script to load the saved authentication context
pyproject.toml Updates project dependencies with authentication-related packages
docs/index.md Updates documentation with guides for authentication
compose.yaml Includes a pgadmin service configuration
.streamlit/config.yaml Provides a sample configuration file for authentication credentials
Files not reviewed (2)
  • .streamlit/secrets.toml.example: Language not supported
  • Makefile: Language not supported
Comments suppressed due to low confidence (1)

workshop_playwright_python/apps/authentication.py:7

  • Verify that 'st.login' (and similarly 'st.logout' used later) are implemented in your current version of Streamlit, or provide the necessary definitions to ensure they work as expected.
st.button("Log in with Microsoft", on_click=st.login)

Comment on lines +23 to +24

if st.session_state["authentication_status"]:
Copy link
Preview

Copilot AI May 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider handling a failed login scenario explicitly (e.g. by returning after catching the LoginError) to avoid potential key errors on st.session_state when login fails.

Suggested change
if st.session_state["authentication_status"]:
st.stop() # Stop further execution if login fails
if st.session_state.get("authentication_status"): # Safeguard to check key existence

Copilot uses AI. Check for mistakes.

@ks6088ts ks6088ts merged commit 4b1b40b into main May 1, 2025
4 checks passed
@ks6088ts ks6088ts deleted the feature/issue-3_add-demo-app branch May 1, 2025 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add simple web app for demonstration
1 participant